//
//  DHNavigationController.m
//  lotteryticket
//
//  Created by DH on 16/4/16.
//  Copyright © 2016年 http://blog.sina.com.cn/dhios All rights reserved.
//

#import "DHNavigationController.h"
#import "UIImage+DHAdd.h"
@interface DHNavigationController()<UINavigationControllerDelegate>

@end
@implementation DHNavigationController


- (void)viewDidLoad
{
    [super viewDidLoad];
    self.delegate = self;
}

+ (void)initialize
{
    UINavigationBar *navBar = [UINavigationBar appearance];
    navBar.translucent = YES;
    [navBar setBackgroundImage:[UIImage createImageWithColor:DHRGB(253, 207, 42)] forBarMetrics:UIBarMetricsDefault];
    // 253 207 42
//    [navBar setBackgroundColor:DHRGB(253, 207, 42)];
    NSMutableDictionary *titleAttrs = [NSMutableDictionary dictionary];
    titleAttrs[NSForegroundColorAttributeName] = [UIColor blackColor];
    titleAttrs[NSFontAttributeName] = [UIFont boldSystemFontOfSize:18];
    navBar.titleTextAttributes = titleAttrs;
    
    UIBarButtonItem *navItem = [UIBarButtonItem appearance];
    NSMutableDictionary *itemAttrs = [NSMutableDictionary dictionary];
    itemAttrs[NSForegroundColorAttributeName] = [UIColor grayColor];
    itemAttrs[NSFontAttributeName] = [UIFont systemFontOfSize:15];
        [navItem setTitleTextAttributes:itemAttrs forState:UIControlStateNormal];
    
}
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if (self.viewControllers.lastObject == viewController && self.viewControllers.count == 1) {
//        self.tabBar.hidden = NO;
    } else {
//        self.tabBar.hidden = YES;
    }
}



@end
